import 'package:smartidea_shop/views/home/home.dart';
import 'package:smartidea_shop/views/web_view/web_view.dart';
import 'package:smartidea_shop/views/search_view.dart';
import 'package:smartidea_shop/views/errors/not_fund.dart';
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';

var notFoundHandler =
    Handler(handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
  return const NotFundPage();
});
var rootHandler =
    Handler(handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
  return const HomeView();
});

var searchHandler =
    Handler(handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
  print('searchHandler $params');
  return const SearchView();
});

var webViewHandler =
    Handler(handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
  print('webViewHandler params $params');
  final url = params['url']?.first;
  print('webViewHandler url $url');
  // String url = params["url"];
  // print('webViewHandler url$url');
  return WebView(url: url);
});
